<?php 
require_once('Admin/Common/template/inc_admin.php');
?>

<div id="content">
	<div class="inner" style="min-height:1200px;">
		<?php
		$row = $data['news'];
	   //var_dump($row); 
		$nid = $row['nid'];
		$ntid = $row['ntid'];
			$newsname = $row['newsname']; 
		$pic = './upload/'.$row['pic'];
	
		$publishtime = $row['publishtime'];		
		
		$content = $row['content'];
		
		
		//var_dump($row);
		?>
		<div class="container">
			<div class="col-md-6 col-md-offset-3">
				<h3 class="text-center"> 修改新闻信息 </h3>
				<br/>
				<form method="post" action="admin.php?c=news&m=update" enctype="multipart/form-data" class="form-horizontal">
					<input type="hidden" name="nid"  value=<?php echo $nid;?>>
					
                  <div class="form-group">
						<label class="col-md-2 col-sm-offset-2 control-label" >新闻类别</label>
						<div class="col-md-4" >
							<select class="form-control" name="ntid">
							    <option value="1" <?php if ($ntid=='1')  echo 'selected'; ?>>社会新闻</option>
								<option value="2" <?php if ($ntid=='2')  echo 'selected'; ?>>娱乐新闻</option>
								<option value="3" <?php if ($ntid=='3')  echo 'selected'; ?>>财经新闻</option>
								<option value="4" <?php if ($ntid=='4')  echo 'selected'; ?>>军事新闻</option>
								<option value="5" <?php if ($ntid=='5')  echo 'selected'; ?>>体育新闻</option>
								<option value="6" <?php if ($ntid=='6')  echo 'selected'; ?>>其他</option>

							</select>
						</div>  
					</div> 
					<div class="form-group">
						<label for="exampleInputUserName1" class=" control-label col-sm-offset-2 col-md-2 ">新闻标题</label>
						<div class=" col-md-4" >
							<input type="text" name="newsname" class="form-control" id="exampleInputUserName1" value=<?php echo $newsname; ?>>
						</div>  
					</div>
					
					<div class="form-group">
						<label for="exampleInputnewsName1" class="col-md-2 col-sm-offset-2 control-label">上传时间</label>
						<div class="col-md-4" >
							<input type="date" name="publishtime" class="form-control" id="exampleInputnewsName1" value=<?php echo $publishtime; ?>>
						</div>  
					</div> 


					 <div class="form-group">
						<label for="exampleInputFile" class="col-md-2 col-sm-offset-2 control-label">图片</label>
						<div class="col-md-4" >
							<input type="file" name="pic" id="exampleInputFile">图片<img src="<?php  echo $pic; ?>" width="80px" height="80px" class="img-circle">
						</div>  
					</div>
					<div class="form-group">
						<label for="exampleInputTextarea1" class="col-md-2 col-sm-offset-2 control-label">新闻内容</label>
						<div class="col-md-4" >
							<textarea class="form-control" id="exampleInputTextarea1" name="content" cols="40" rows="5" ><?php    echo $content; ?></textarea>
						</div>  
					</div>
					
					<div class="form-group">
						<div class="col-sm-offset-7 col-sm-4" >
							<input type="submit" class="btn btn-success" value="更新">
						</div>  
					</div>
				</form>
			</div>


		</div>
	</div>
